import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
import MapView from '@/views/MapView.vue'
import POIDetail from '@/views/POIDetail.vue'
import RoutePlan from '@/views/RoutePlan.vue'

const routes: RouteRecordRaw[] = [
  { path: '/', redirect: '/map' },
  { path: '/map', name: 'MapView', component: MapView },
  { path: '/route', name: 'RoutePlan', component: RoutePlan },
  { path: '/detail/:id', name: 'POIDetail', component: POIDetail }  // ✅ 新增

]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
